package org.bot.server.client.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.bot.client.driver.api.client.ClientOpenApi;
import org.bot.server.client.entity.BotClient;
import org.bot.server.client.mapper.BotClientMapper;
import org.bot.server.client.service.BotClientService;
import org.bot.server.client.service.BotClientSocketDriveService;
import org.bot.server.flow.entity.BotFlow;
import org.bot.server.flow.mapper.BotFlowMapper;
import org.bot.server.job.FlowQuartzJob;
import org.bot.server.utils.ServletUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * @author 沧月
 * @create 0020 2023/9/20 09:48
 * @description <description class purpose>
 */
@Service
public class BotClientSocketDriveServiceImpl implements BotClientSocketDriveService {

    @Autowired
    BotClientMapper botClientMapper;

    @Override
    public Map<String, Object> getClientInfo(String clientId) {
        return botClientMapper.getBotFlowInfo(clientId);
    }

    @Override
    public void updateMac(Integer id, String mac) {
        BotClient client = new BotClient();
        client.setDeviceId(mac);
        client.setActivateStatus(1);
        client.setId(id);
        botClientMapper.updateById(client);
    }
}
